<template>
  <!-- <h4>当前是订单管理-- 订单基本信息  Facility</h4> -->
  <div>
  
    
    <el-table :data="tableData" border style="width: 100%">
      
       <el-table-column prop="orderNumber" label="订单号" width="220px"> </el-table-column>
      <el-table-column prop="money" label="支付金额"> </el-table-column>
      <el-table-column prop="orderStatus" label="订单状态"> </el-table-column>
      <el-table-column prop="number" label="编号">
        <template slot-scope="scope">
          <el-button @click="handleClicknumber(scope.row)" type="text" size="big">{{scope.row.number}}</el-button>
        </template>
      </el-table-column>
     
      <el-table-column prop="username" label="用户"> </el-table-column>
      <el-table-column prop="defary" label="支付状态"> </el-table-column>
      <el-table-column prop="defarytime" label="支付时间" width="180px"> </el-table-column>
      <el-table-column prop="defarytypes" label="支付渠道"></el-table-column>
      	<!-- <el-table-column
					prop="status"
					label="是否启用">
				<template slot-scope="scope">
					<el-tag size="small" v-if="scope.row.status === 1" type="success">已启用</el-tag>
					<el-tag size="small" v-else-if="scope.row.status === 0" type="danger">已禁用</el-tag>
				</template>

			</el-table-column> -->
      <el-table-column prop="projectName" label="项目"> 
         <template slot-scope="scope">
          <el-button @click="handleClickProject(scope.row)" type="text" size="big">{{scope.row.projectName}}</el-button>
     
        </template>
      </el-table-column>
      <el-table-column prop="address" label="投放位置"> </el-table-column>
      <el-table-column fixed="right" label="操作">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="big"
            >编辑项目</el-button
          >
          <template>
						<el-popconfirm title="这是一段内容确定删除吗？" @confirm="handleDelete(scope.row.id)">
							<el-button type="text" slot="reference">删除</el-button>
						</el-popconfirm>
					</template>
         
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="current"
      :page-sizes="[5,10, 15, 20, 30]"
      :page-size="size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
   
  
  </div>
</template>

<script>


export default {
  name: "admin",
  data() {
    return {
      dialogVisible: false,
      dialogClaim: false,
      active:1,
      selectData: [],
      tableData: [],
      payTime: [], // 收入日期
      payTime1:null , // 收入日期1
      payTime2: null, // 收入日期2
     
     
      total: 0,
      size: 10,
      current: 1,
    };
  },
   
  created() {
    this.selectDataMethod();
    this.getOrderList();
  },
  methods: {

   
   
   
   
   
  
    handleSizeChange(val) {
      console.log(`每页条` + val);
      this.size = val;
      this.getOrderList();
    },
    handleCurrentChange(val) {
      console.log(`当前页: ` + val);
      this.current = val;
      this.getOrderList();
    },
   
   
   
    // 查询全部的项目信息
    selectDataMethod() {
      this.$axios
        .get("/tProjectBase/list", {
          params: {
            current: 0,
            size: 0,
          },
        })
        .then((res) => {
          console.log(res.data.data);
          this.selectData = res.data.data;
        });
    },
    //  条件查询设备信息

    getOrderList() {
      console.log(this.formInline)
      console.log(this.payTime)
      this.$axios
        .get("/tPayOrder/list", {  
          params: {
            page: this.current,
            limit: this.size,
            orderNumber: this.formInline.orderNumber,
            number: this.formInline.number,
            date1: this.payTime[0],
            date2: this.payTime[1],
            projectid: this.formInline.projectid,
            defarystatus: this.formInline.defarystatus,
          },
        })
        .then((res) => {
          console.log(res);
          this.tableData = res.data.data;

          this.total = res.data.count;
        });
    },
    
  
   
    ///  点击设备编号，到一个具体的设备信息页面
    handleClicknumber(row) {
      this.$router.push({ path: "/facility/FacilityBase/" + row.number });
      console.log(row);
    },
    //点击一个项目名称，到一个具体的项目信息的页面
    handleClickProject(row) {
      this.$router.push({ path: "/sys/ProjectBser/" + row.projectid });
      console.log(row);
    },
  },
};
</script>

<style scoped>
  /*步骤条的高度*/
  .box3 >>> .el-step.is-vertical {
    height: 50%;
  }
</style>